const controlFn = ($scope, $timeout, apiActions)=>{
      var service = apiActions.list;
      console.log("searchHome");
      //饼图
     $scope.$on('chart-pie',function(e,data){
        console.log(e);
        $timeout(function(){
            if(e.targetScope.type == 'surveyIndex'){    //首页点击占比
                var lData = ['内容','消息列表','个人中心'];
                e.targetScope.pieChart(data,lData);
            }else if(e.targetScope.type == 'surveysex'){  //性别占比
                var lData = ['男','女','男女'];
                e.targetScope.pieChart(data,lData);
            }
        })
        });
        //环形图 - 年龄段占比
        $scope.$on('circle-chart',function(e,data){
            console.log(e)
        $timeout(function(){
            if(e.targetScope.type == 'surveyage'){
                console.log("surveyage")
                e.targetScope.circleChart(data);
            }
        })
      });
      //3列柱状图 - 点击情况柱状图
      $scope.$on('chart-histogram-three',function(e,data){
            console.log(e)
        $timeout(function(){
            if(e.targetScope.type == 'surveyclick'){
                console.log("surveyclick")
                e.targetScope.histogramThreeChart(data);
            }
        })
      });
    }

export default controlFn